package config;

import annotations.Configuration;
import annotations.Bean;
import services.UserService;
import services.OrderService;

@Configuration
public class AppConfig {

    @Bean
    public UserService userService() {
        return new UserService();
    }

    @Bean(name = "orderService")
    public OrderService orderService() {
        // 手动注入依赖
        return new OrderService(userService());
    }

    @Bean
    public String appName() {
        return "Simple IOC Container Demo";
    }

    @Bean(name = "welcomeMessage")
    public String welcome() {
        return "Welcome to our application!";
    }
}